//
//  UIListView.m
//  iphoneMobo
//
//  Created by Mac Book-1 on 10-7-16.
//  Copyright 2010 shijiazheng. All rights reserved.
//

#import "UIListView.h"
#import "ListItem.h"
@implementation UIListView

@synthesize iItemsArray;
@synthesize iType;
@synthesize iAbsoluteY;


- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
	if ((self = [super initWithFrame:frame style:style])) {
        iItemsArray = [[NSMutableArray alloc] init];
		//iType = KListView;
		iItemHeight = 30;
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
	[iItemsArray release];
	//[self setDelegate:nil];
	//[self setDataSource:nil];
    [super dealloc];
}

-(void) addItme:(id) aItem
{
	[iItemsArray addObject:aItem];
	[aItem release];
}

-(int) getItmeHeight
{
	int count = self.iItemsArray.count;
	if (count > 0) {
		ListItem* item = [self.iItemsArray objectAtIndex:0];
		CGSize imgSize;
		int height = 0;
		if (item.iFlagImageName) {
			imgSize = [[CImageFactory getInstance] getImageSize:item.iFlagImageName];
			height = imgSize.height + 8;
		}
		
		if (height < 18 * 2 + 8) {//字体高度 间隔
			height = 18 * 2 + 8;
		}
		iItemHeight = height;
	}
	return iItemHeight;
}

-(void) setItmeHeight:(int) aHeight
{
	iItemHeight = aHeight;
}

@end
